package com.software.factory;

import java.util.Scanner;

public class SimpleFactoryDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = "";
        while (!s.equals("exit")) {
            System.out.println("请输入要生产的图形");
            s = scanner.nextLine();
            Shape shape = ShapeFactory.getShape(s);
            if (shape != null)
                shape.draw();
            else
                System.out.println("输入有误重新输入");
        }

    }
}
